/**
* Copyright (c) By zengqh.
*
* This program is just for fun or demo, in the hope that it  
* will be useful, you can redistribute it and/or modify freely.
*
* Time: 2012/07/18
* File: RawSceneNode.h
* Blog: http://www.cnblogs.com/zengqh/
**/

#ifndef RawSceneNode_h__
#define RawSceneNode_h__

#include "../Core/Core.h"
#include "../Core/Declare.h"
#include "SceneNode.h"
#include "../RenderSystem/MaterialData.h"

class RawSceneNode : public SceneNode
{
public:
	RawSceneNode(SceneNode* parent, 
		SceneManager* scene_mgr, 
		s32 id = -1,
		s32 type = 0,
		const glm::vec3& position = glm::vec3(0.0f, 0.0f, 0.0f),
		const glm::vec3& rotation = glm::vec3(0.0f, 0.0f, 0.0f),
		const glm::vec3& scale = glm::vec3(1.0f, 1.0f, 1.0f));

	~RawSceneNode();

	void render();

	void setVertexBuffer(void* data, u32 size_in_byte, FVFState state);
	void setIndexBuffer(void* data, u32 primitive_count, bool is_index_16bit);
	void setMaterial(const MaterialData& material);
	void setRenderEffectService(EffectService* es);

	virtual void move(f32 distance);
	virtual void moveLR(f32 distance);

protected:
	GraphicsBuffer*		_vbo_buffer;
	GraphicsBuffer*		_idx_buffer;
	MaterialData		_material;
	FVFState			_fvf_state;
	u32					_primitive_count;
	bool				_is_index_16bit;
	EffectService*		_effect_service;
};

#endif    /* RawSceneNode_h__ */